local sk__dailao = fk.CreateSkill {

  name = "sk__dailao",

  tags = {  },

}



sk__dailao:addEffect("active", {
  name = "sk__dailao",
  anim_type = "control",
  card_num = 0,
  target_num = 1,
  prompt = "#sk__dailao",
  can_use = function(self, player)
    return player:usedSkillTimes(sk__dailao.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  target_filter =function (self, player, to_select, selected, selected_cards)
    return #selected == 0 and to_select ~= player
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    local choices = {"sk__dailao_draw"}
    if not player:isNude() or not target:isNude() then
      table.insert(choices, "sk__dailao_discard")
    end
    local choice = room:askForChoice(player, choices, sk__dailao.name, "#sk__dailao-choice::"..target.id)
    if choice == "sk__dailao_draw" then
      player:drawCards(1, sk__dailao.name)
      if not target.dead then
        target:drawCards(1, sk__dailao.name)
      end
    else
      room:askForDiscard(player, 1, 1, true, sk__dailao.name, false)
      if not target.dead then
        room:askForDiscard(target, 1, 1, true, sk__dailao.name, false)
      end
    end
    if not player.dead then
      player:turnOver()
    end
    if not target.dead then
      target:turnOver()
    end
  end,
})

return sk__dailao